/// 返回UTC日期时间
#[inline(always)]
pub fn utc_time() -> DateTime
{
    unsafe {
        let mut time = std::mem::zeroed::<windows_sys::Win32::Foundation::SYSTEMTIME>();
        windows_sys::Win32::System::SystemInformation::GetSystemTime(&mut time as *mut windows_sys::Win32::Foundation::SYSTEMTIME);
        DateTime {
            year: time.wYear,
            month: time.wMonth as u8,
            day: time.wDay as u8,
            week: time.wDayOfWeek as u8,
            hour: time.wHour as u8,
            minute: time.wMinute as u8,
            second: time.wSecond as u8,
        }
    }
}

/// 返回本地日期时间
#[inline(always)]
pub fn local_time() -> DateTime
{
    unsafe {
        let mut time = std::mem::zeroed::<windows_sys::Win32::Foundation::SYSTEMTIME>();
        windows_sys::Win32::System::SystemInformation::GetLocalTime(&mut time as *mut windows_sys::Win32::Foundation::SYSTEMTIME);
        DateTime {
            year: time.wYear,
            month: time.wMonth as u8,
            day: time.wDay as u8,
            week: time.wDayOfWeek as u8,
            hour: time.wHour as u8,
            minute: time.wMinute as u8,
            second: time.wSecond as u8,
        }
    }
}

/// 获取系统启动以来经过的毫秒数
#[inline(always)]
pub fn tick_count() -> u64
{
    unsafe { windows_sys::Win32::System::SystemInformation::GetTickCount64() }
}